{template 'common/header'}
<ol class="breadcrumb we7-breadcrumb">
	<a href="{php echo $this->createWebUrl('caselist',array('module_type'=>'system_welcome'));}"><i class="wi wi-back-circle"></i> </a>
	<li>
		<a href="{php echo $this->createWebUrl('caselist',array('module_type'=>'system_welcome'));}">案例管理</a>
	</li>
	<li>
		添加案例
	</li>
</ol>
<div class="clearfix">
	<form action="{php echo $this->createWebUrl('casesave',array('module_type'=>'system_welcome'))}" method="post" class="we7-form" role="form" id="form1">
		<input type="hidden" name="case_id" value="{$case['case_id']}"/>
		<div class="form-group">
			<label class="col-sm-2 control-label">案例名称</label>
			<div class="col-sm-8">
				<input type="text" class="form-control" name="case_name" value="{$case['case_name']}" placeholder="案例名称"/>
				<div class="help-block">请填写案例名称</div>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">缩略图</label>
			<div class="col-sm-8">
				{php echo tpl_form_field_image('case_thumb', $case['case_thumb']);}
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">内容</label>
			<div class="col-sm-8">
				{php echo tpl_ueditor('case_content', $case['case_content']);}
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">是否显示</label>
			<div class="col-sm-8">
				<input type="radio" name="is_show" id="is_show-1" value="1" {if $case['is_show'] == 1} checked{/if}> 
				<label class="radio-inline" for="is_show-1">是</label>
				<input type="radio" name="is_show" id="is_show-0" value="0" {if $case['is_show'] == 0} checked{/if}>
				<label class="radio-inline" for="is_show-0"> 否</label>
			</div>
		</div>
		<div class="form-group">
			<div class="">
				<input type="submit" class="btn btn-primary"  value="提交" />
			</div>
		</div>
	</form>
</div>
<script>
	$(function(){
		$('#form1').submit(function(){
			if(!$.trim($(':text[name="case_name"]').val())) {
				util.message('请填写案例名称', '', 'error');
				return false;
			}
			if(!$.trim($(':text[name="case_thumb"]').val())) {
				util.message('请上传缩略图', '', 'error');
				return false;
			}
			if(!$.trim($('textarea[name="case_content"]').val())) {
				util.message('请填写案例内容', '', 'error');
				return false;
			}
			return true;
		});
	});
</script>
{template 'common/footer'}
